/**
 * @author Vitor Franco do Carmo (vitor.carmo@capgemini.com)
 * @since 08/04/2013
 *
 */
package br.com.vfcfw.controller.handler;

import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExceptionHandlerFactory;

/**
 * Fábrica da {@link ApplicationExceptionHandler}.
 * 
 * @author Vitor Franco do Carmo (vitor.carmo@capgemini.com)
 * @since 08/04/2013
 * 
 */
public class ApplicationExceptionHandlerFactory extends ExceptionHandlerFactory {

    private ExceptionHandlerFactory parent;

    /**
     * Construtor da classe.
     * 
     * @param parent {@link ExceptionHandlerFactory}.
     */
    public ApplicationExceptionHandlerFactory(ExceptionHandlerFactory parent) {

        super();
        this.parent = parent;
    }

    /**
     * {@inheritDoc}
     * 
     * @see javax.faces.context.ExceptionHandlerFactory#getExceptionHandler()
     */
    @Override
    public ExceptionHandler getExceptionHandler() {

        return new ApplicationExceptionHandler(parent.getExceptionHandler());
    }
}
